package com.caocaog.market.error;


/**
 * @author yuki Guo
 * Date 2021/11/14 10:51
 * Copyright (C) http://www.peppa.vip
 */
public enum ApiErrorCode implements IErrorCode {

    LACK_TOKEN(3000L, "没有登录"),
    NO_USERNAME(3005L, "用户不存在"),
    ACCOUNT_PASSWORD_FAILED(100100,"用户名或密码错误"),
    ACCOUNT_ALREADY_EXISTS(100101,"该账号已经被注册"),
    NEED_BIND_ACCOUNT(100102,"需要绑定账号"),
    ACCOUNT_ALREADY_AUTH(100103,"该账号已经被授权请换新的手机号"),
    TOKEN_ERROR(100105,"token错误"),
    ACCOUNT_IS_DISABLED(100106,"你的账号被锁定，请联系客服"),
    ACCOUNT_NOT_EXIST(100107,"该账号不存在"),
    ACCOUNT_BALANCE_NOT_ENOUGH(100108,"余额不足"),
    NICKNAME_ALREADY_EXISTS(100110,"该昵称已经被注册"),
    IDENTITY_CARD_EXISTS(100112,"该身份证号已存在"),
    PHONE_EXISTS(100113,"该联系电话已存在"),
    SHOP_IS_EXISTS(100115,"您的申请已经通过了,无须重复申请"),
    SHOP_IS_APPLY(100116,"您的申请正在审核,请耐心等待"),
    SHOP_IS_REFUSE(100117,"您的店铺申请被拒绝了,若要再次申请请联系客服"),
    PASSWORD_IS_REPETITION(100118,"新密码不能与旧密码重复"),
    ;


    private final long code;

    private final String msg;

    ApiErrorCode(final long code, final String msg) {
        this.code = code;
        this.msg = msg;
    }


    @Override
    public long getCode() {
        return code;
    }

    @Override
    public String getMessage() {
        return msg;
    }

    @Override
    public String toString() {
        return String.format(" ErrorCode:{code=%s, msg=%s} ", code, msg);
    }
}

